<!doctype html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Title</title>
    <link th:insert="common/head :: commonheader">
</head>
<body style="background-color: #F5F6FA">
    <div class="container">
        <div class="row clearfix">
            <div class="col-md-12 column">
                <div th:insert="common/head :: header">
                </div>
                <div class="jumbotron" style="background-color: #fff; margin-bottom: 5px; border: 1px solid #eeeeee;">
                    <div class="search_form">
                        <form class="form-inline" th:action="@{/search}" method="post">
                            <select class="form-control" style="height: 45px;" name="option">
                                <option value="0" th:selected="${session.optionS}">找工作</option>
                                <option value="1" th:selected="${session.optionS}">找工人</option>
                            </select>
                            <div class="form-group ">
                                <input type="text" class="search_input" id="exampleInputEmail3" placeholder="找工、找活" name="address">
                            </div>
                            <button type="submit" class="btn btn-default">搜索</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="container" th:if="${CWpage}">
        <div class="row">
            <div class="col-md-12">
                <div class="media well findwork-work" th:each="work:${CWpage.list}">
                    <div class="media-body">
                        <h4 class="media-heading">
                            <b th:text="${work.getTitle().length()<14?work.getTitle():work.getTitle().substring(0,14)+'...'}"></b>
                            <div class="text-right" style="float: right"><span class="glyphicon glyphicon-fire" style="color: red" th:if="${work.getState()==0}">正在招</span></div>
                            <div class="text-right" style="float: right"><span class="glyphicon glyphicon-fire" style="color: #6b6969" th:if="${work.getState()==1}">已招满</span></div>
                        </h4>
                        <div th:text="${work.getWorkDescribe().length()<100?work.getWorkDescribe():work.getWorkDescribe().substring(0,100)}+'...'" style="height: 30px;">
                        </div>
                        <div class="media" >
                            <a href="#" class="pull-left"><img th:src="@{'/user/' + ${work.getUser().getUserImg()}}" height="35" width="35" class="media-object" alt='' /></a>
                            <div class="media-body">
                                <div style="margin-top: 8px; padding: 0px;">联系人:
                                    <span th:text="${work.getUser().getRealName()}"></span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <div style="display: inline-block" th:text="${work.getPublishTime()}"></div>
                                    <a class="btn btn-default" href="#" role="button" style="float:right">立刻联系</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="ui attached segment" style="display:flex; justify-content:center;">
            <table class="m-mobile-wide" width="425px">
                <tbody>
                <tr align="center" >
                    <td>
                        <a th:href="@{${#httpServletRequest.getRequestURI()} + '?pageNum=' + ${CWpage.pageNum - 1}}"  class="ui button basic mini" th:unless="${CWpage.isFirstPage}">上一页</a>
                    </td>
                    <td>
                        第
                        <h8 th:text="${CWpage.pageNum}">2</h8>
                        页/共
                        <h8 th:text="${CWpage.pages}">4</h8>
                        页
                        共
                        <h8 th:text="${CWpage.total}">29</h8>
                        条
                    </td>
                    <td> &nbsp;</td>
                    <td  style="float: right">
                        <a th:href="@{${#httpServletRequest.getRequestURI()} + '?pageNum=' + ${CWpage.pageNum+1}}" class="ui button basic mini " style="float: right;" th:unless="${CWpage.isLastPage}">下一页</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <footer th:insert="common/head :: footer">

        </footer>
    </div>

    <div class="container" th:if="${EWpage}">
        <div class="row">
            <div class="col-md-12" id="worker_box">
                <div class="media well gongren-work" id="box0" th:each="work:${EWpage.list}" style="background-color: #ffffff; margin-bottom: 5px;margin-top: 5px;">
                    <div class="media-body row">
                        <div class="row">
                            <div class="col-md-1">
                                <a href="#" class="pull-left"><img th:src="@{'/user/' + ${work.getUser().getUserImg()}}" height="60" width="60" class="media-object" alt='' /></a>
                            </div>

                            <div class="col-md-9" style="padding: 0;">
                                <h4 class="media-heading">
                                    <b th:text="${work.getUser().getRealName()}"></b></h4>
                                <span>性别:</span>
                                <span th:text="${work.getUser().getSex()==0?'男':'女'}"></span>
                                <span th:text="|年龄:${work.getUser().getAge()} 工种:${work.getExpectedWork()} |"></span>
                                <span >工作性质:</span>
                                <span th:if="${work.getWorkNature()==0}">兼职</span>
                                <span th:if="${work.getWorkNature()==1}">长期工</span>
                                <span th:if="${work.getWorkNature()==2}">高级工</span>
                                </span><br>

                                <div class="media">
                                    <div class="media-body">
                                        <div style="margin-top: 0; padding: 0px;">
                                            <p class="text-defult" th:text="${work.getMyselfDescribe()}"></p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-2" style="padding: 0;">
                                <a class="btn btn-primary" href="#" role="button" style="float: left; margin-left: 90px;">立刻联系</a>
                                <div style="float: right; margin-top: 20px; margin-right: 20px;"><img src="/images/ic_local.png" style=" width: 16px;height: 16px;"><span class="small text-primary" th:text="${work.address}"></span></div>
                                <div style="float: right; margin-top: 20px; margin-right: 20px;">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="ui attached segment" style="display:flex; justify-content:center;">
            <table class="m-mobile-wide" width="425px">
                <tbody>
                <tr align="center">
                    <td>
                        <a th:href="@{${#httpServletRequest.getRequestURI()} + '?pageNum=' + ${EWpage.pageNum - 1}}"  class="ui button basic mini" th:unless="${EWpage.isFirstPage}">上一页</a>
                    </td>
                    <td>
                        第
                        <h8 th:text="${EWpage.pageNum}">2</h8>
                        页/共
                        <h8 th:text="${EWpage.pages}">4</h8>
                        页
                        共
                        <h8 th:text="${EWpage.total}">29</h8>
                        条
                    </td>
                    <td> &nbsp;</td>
                    <td  style="float: right">
                        <a th:href="@{${#httpServletRequest.getRequestURI()} + '?pageNum=' + ${EWpage.pageNum+1}}" class="ui button basic mini " style="float: right;" th:unless="${EWpage.isLastPage}">下一页</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <footer th:insert="common/head :: footer">

        </footer>
    </div>




</body>
</html>